package org.adorsys.aderp.aderplogin.security.token;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class InMemoryActiveClientStore implements ActiveClientStore {

	private Map<String, Set<String>> activeClients = new HashMap<String, Set<String>>();
	
	@Override
	public void storeActiveClient(String token, String clientId) {
		Set<String> activeKl = activeClients.get(token);
		if(activeKl==null) {
			activeKl = new HashSet<String>();
			activeClients.put(token, activeKl);
		}
		activeKl.add(clientId);
	}

	@Override
	public Set<String> loadActiveClients(String token) {
		return activeClients.get(token);
	}
}
